package com.exam.huawei;

/**
 * date:
 * description:
 */
public class Solution11 {
    public static void main(String[] args) {

    }

    public static int findNum(int x, int y){
        int res = 0;
        if(x >= 0 && y >= 0){
            res -= y;
            int innerSide = 2*(x - 1);
            int innerArea = innerSide * innerSide;
            int lowerHalf = (innerSide + 1) / 2;
            int outerSide = 2 * x;
            int outerRound = outerSide * 4 - 4;
            res += innerArea + lowerHalf + outerRound / 2;
        }else if (x >= 0 && y < 0){
            res -= y;
            int innerSide = 2*(x - 1);
            int innerArea = innerSide * innerSide;
            int lowerHalf = (innerSide + 1) / 2;
            int outerSide = 2 * x;
            int outerRound = outerSide * 4 - 4;
            res += innerArea + lowerHalf + outerRound / 2;
        }
        return 0;
    }
}
